package com.bkhech.picocli;

import org.springframework.boot.ExitCodeGenerator;
import org.springframework.stereotype.Component;
import picocli.CommandLine;

@CommandLine.Command(
        name = "manager",
        description = "The manager description",
        showAtFileInUsageHelp = true,
        mixinStandardHelpOptions = true,
        subcommands = {
                ListCommand.class,
        })
@Component
public class ConnectCommand implements Runnable, ExitCodeGenerator {
    @CommandLine.Option(
            names = {"-u", "--username"},
            description = "The username",
            required = true)
    private String username;

    @CommandLine.Option(
            names = {"-p", "--password"},
            description = "The password",
            required = true)
    private String password;

    private int exitCode;

    @Override
    public void run() {
        // WIP: kick-off shell
        System.out.println("username: " + username);
        System.out.println("password: " + password);
    }

    @Override
    public int getExitCode() {
        return exitCode;
    }

}